<?php
namespace Infinity;


class MultipleEntityForm {
  public static function submit($form, &$form_state) {
    multiple_entity_form_submit($form, $form_state);

    foreach ($form['#entity_form_keys'] as $form_key) {
      $entity_type  = $form[$form_key]['#entity_type'];
      $entity       = $form[$form_key]['#entity'];

      entity_save($entity_type, $entity);
    }
  }
} 